<template>
  <div class="dashboard-container">
    <component :is="currentRole" />
  </div>
</template>

<script lang="ts">
import { UserModule } from '@/store/modules/user'
import AdminDashboard from './admin/index.vue'
import EditorDashboard from './editor/index.vue'

export default {
  name: 'Dashboard',
  components: {
    AdminDashboard,
    EditorDashboard,
  },
  computed: {
    currentRole() {
      return !UserModule.roles.includes('admin')
        ? 'editor-dashboard'
        : 'admin-dashboard'
    },
  },
}
</script>
